package com.ruoyi.sale.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sale.mapper.SaleReturnDetailMapper;
import com.ruoyi.sale.domain.SaleReturnDetail;
import com.ruoyi.sale.service.ISaleReturnDetailService;

/**
 * 退货单详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-03
 */
@Service
public class SaleReturnDetailServiceImpl implements ISaleReturnDetailService 
{
    @Autowired
    private SaleReturnDetailMapper saleReturnDetailMapper;

    /**
     * 查询退货单详情
     * 
     * @param id 退货单详情主键
     * @return 退货单详情
     */
    @Override
    public SaleReturnDetail selectSaleReturnDetailById(Long id)
    {
        return saleReturnDetailMapper.selectSaleReturnDetailById(id);
    }

    /**
     * 查询退货单详情列表
     * 
     * @param saleReturnDetail 退货单详情
     * @return 退货单详情
     */
    @Override
    public List<SaleReturnDetail> selectSaleReturnDetailList(SaleReturnDetail saleReturnDetail)
    {
        return saleReturnDetailMapper.selectSaleReturnDetailList(saleReturnDetail);
    }

    /**
     * 新增退货单详情
     * 
     * @param saleReturnDetail 退货单详情
     * @return 结果
     */
    @Override
    public int insertSaleReturnDetail(SaleReturnDetail saleReturnDetail)
    {
        saleReturnDetail.setCreateTime(DateUtils.getNowDate());
        return saleReturnDetailMapper.insertSaleReturnDetail(saleReturnDetail);
    }

    /**
     * 修改退货单详情
     * 
     * @param saleReturnDetail 退货单详情
     * @return 结果
     */
    @Override
    public int updateSaleReturnDetail(SaleReturnDetail saleReturnDetail)
    {
        saleReturnDetail.setUpdateTime(DateUtils.getNowDate());
        return saleReturnDetailMapper.updateSaleReturnDetail(saleReturnDetail);
    }

    /**
     * 批量删除退货单详情
     * 
     * @param ids 需要删除的退货单详情主键
     * @return 结果
     */
    @Override
    public int deleteSaleReturnDetailByIds(Long[] ids)
    {
        return saleReturnDetailMapper.deleteSaleReturnDetailByIds(ids);
    }

    /**
     * 删除退货单详情信息
     * 
     * @param id 退货单详情主键
     * @return 结果
     */
    @Override
    public int deleteSaleReturnDetailById(Long id)
    {
        return saleReturnDetailMapper.deleteSaleReturnDetailById(id);
    }
}
